<?php
/**
 * 2018-07-26
 * UTF-8
 */
class Module_Uaction_UactionRecord {
    private static $obj = null;
    private $model = null;
    public static $action_type_arr = array(
        '1' => '添加用户',
        '2' => '编辑用户',
        '3' => '修改密码',
        '4' => '登录后台',
        '5' => '删除用户',
        '6' => '添加权限',
        '7' => '编辑权限',
        '8' => '删除权限',
        '9' => '添加角色',
        '10' => '编辑角色',
        '11' => '删除角色',
    );

    public static $source_type_arr = array(
        '0' => '全部',
        '1' => '多元化解系统',
        '2' => '结构案件管理系统',
    );
    public static $action_res_arr = array(
        '0' => '失败',
        '1' => '成功'
    );

    /**
     * 封闭构造
     */
    private function __construct(){
        $this->model = new Model_Uaction_UactionRecord();
    }

    /**
     * 单例获取
     * 保证一条进程只产生一个Module对象
     */
    public static function getInstance() {
        if (empty ( self::$obj )) {
            self::$obj = new Module_Uaction_UactionRecord();
        }
        return self::$obj;
    }

    /**
     * @param $data
     * @return mixed
     * 添加入库方法
     */
    public function addData($data)
    {
        $res = $this->model->addData($data);
        return $res;
    }

    /**
     * @param array $fields
     * @param array $search
     * @param bool $cache
     * @return mixed
     */
    public function getAllBySearch($fields = array(),$search = array(),$cache = false){
        return $this->model->getAllBySearch($fields,$search,$cache);
    }

}